
//自定义组件--闪一闪的时钟
module components {
	export class TimeClock extends eui.Component {
		public constructor() {
			super();
			this.addEventListener(eui.UIEvent.COMPLETE, this.init, this);
			this.skinName = "resource/ui/components/TimeClockSkin.exml";
		}
		public time1: eui.Label;
		public time2: eui.Label;
		private init() {
			this.time1.text = Global.getCurrTimeYMDHMS(false) + "";
			let t1 = egret.setInterval(() => {
				try {
					this.time1.text = Global.getCurrTimeYMDHMS(false);
				} catch (e) {
					egret.clearInterval(t1);
				}
			}, this, 1000 * 60);
			let t2 = egret.setInterval(() => {
				try {
					if (this.time2.visible) {
						this.time2.visible = false;
					} else {
						this.time2.visible = true;
					}
				} catch (e) {
					egret.clearInterval(t2);
				}
			}, this, 500);
		}
	}
}